"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
var rxjs_1 = require("rxjs");
var operators_1 = require("rxjs/operators");
var functions_1 = require("../../functions");
var Meepo = /** @class */ (function (_super) {
    __extends(Meepo, _super);
    function Meepo() {
        return _super.call(this) || this;
    }
    return Meepo;
}(rxjs_1.Subject));
exports.Meepo = Meepo;
function meepoBootstrap(port, host) {
    var meepo = new Meepo();
    functions_1.createExpress(port, host)
        .pipe(operators_1.map(function (data) {
        var req = data.req;
        var res = data.res;
        return {
            req: req,
            res: res
        };
    }))
        .subscribe(function (res) { return meepo.next(res); });
    return meepo;
}
exports.meepoBootstrap = meepoBootstrap;
